home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / KADFILE.ZIP / TEST.C < prev   
C/C++ Source or Header  |  1995-03-06  |  3KB  |  65 lines

  1. /****************************************************************************/
  2. /* Test                                                                     */
  3. /* Functions under DOS4Gw and PmodeW                                        */
  4. /*--------------------------------------------------------------------------*/
  5. /* Coded by Kodiak of The Apollo Project                                    */
  6. /* AKA Charles Jones                                                        */
  7. /*     1122 s 32nd St #2                                                    */
  8. /*     Omaha, NE 68105                                                      */
  9. /*     (402)-346-8974                                                       */
  10. /*                                                                          */
  11. /* Email: CAD@UnOmaha.edu                                                   */
  12. /* IRC  : #Coders                                                           */
  13. /*                                                                          */
  14. /* Copyright 1995 All Rights Reservered                                     */
  15. /* Released to public domain, but hey if you use it greet me.               */
  16. /****************************************************************************/
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include "kad.h"
  20.  
  21. char sentence[100];
  22.  
  23. char errors[8][35] = {
  24.     "File not found",
  25.     "Unable to open KAD file",
  26.     "Internal directory to small",
  27.     "Standard File not found",
  28.     "Read error on file",
  29.     "Unknown file type",
  30.     "Compressed file = 0",
  31.     "Read Error on Compressed File"
  32. };
  33.  
  34.  
  35. /****************************************************************************/
  36. /* Function : error_handler                                                 */
  37. /* IN : error number                                                        */
  38. /* RETURNS:                                                                 */
  39. /*          nothing                                                         */
  40. /****************************************************************************/
  41. /* Note :                                                                   */
  42. /*      This routine will display an error if one occurred!                 */
  43. /****************************************************************************/
  44. void error_handler(int error_num)
  45. {
  46.     if (error_num != 0) {
  47.         if (strcmp(altstr,"") == 0)
  48.             printf("%s\n",errors[error_num-1]);
  49.         else
  50.             printf("%s : %s\n",errors[error_num-1],altstr);
  51.         exit( EXIT_SUCCESS );
  52.     }
  53. }
  54.  
  55. void main()
  56. {
  57.     error_handler(openkadfile("dummy.kad","Kodiak"));
  58.  
  59.     error_handler(getfile("","dummy.ari",&sentence));
  60.     printf("%s\n",sentence);
  61.  
  62.     closekadfile();
  63. }
  64.  
  65.